package com.czk.model.command;

/**
 * @Author:ChenZhangKun
 * @Date: 2020/5/8 22:25
 */
public class Client {
    public static void main(String[] args) {
        // 创建点灯命令接受者
        LightReceiver lightReceiver=new LightReceiver();
        // 打开点灯命令
        Command lightOnCommand=new LightOnCommand(lightReceiver);
        // 关闭电脑命令
        Command lightOffCommand=new LightOffCommand(lightReceiver);
        // 远程操作者
        RemoteController remoteController=new RemoteController();
        // 设置第一组为点灯开关操作
        remoteController.setCommand(0,lightOnCommand,lightOnCommand);
        // 打开点灯
        remoteController.onButtonWasPushed(0);
        // 撤销打开点灯→关闭点灯
        remoteController.undoButtonWasPushed();
    }
}
